import com.myspring.pojo.Hello;
import com.myspring.pojo.People;
import com.myspring.pojo.Student;
import com.print.Printer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("beans.xml");

//        Hello hello=context.getBean("hello",Hello.class);
//        hello.show();
//
//        Student student= (Student) context.getBean("student");
//        System.out.println(student);
//
//        People p1=context.getBean("hello1",People.class);
//        People p2=context.getBean("hello2",People.class);
//        p1.sayHi();
//        p2.sayHi();
//
//        People p3=context.getBean("people26",People.class);
//        People p4=context.getBean("people26-2",People.class);
//        p3.sayHi();
//        p4.sayHi();

        Printer printer=context.getBean("printer3",Printer.class);
        printer.print("hello spring");
        People p5=context.getBean("people5",People.class);
        p5.sayHi();


    }
}
